
const {ccclass, property} = cc._decorator;

@ccclass
export default class NewClass extends cc.Component {
   
    changeProgressBar (dt:number) {
        let sprite=this.node.getComponent(cc.Sprite)
        if (sprite.fillRange <= 0) {
            sprite.fillRange=1;
        }    
        sprite.fillRange -= 0.2*dt;
    }

    // onLoad () {}

    start () {
        
    }

    update (dt:number) {
        this.changeProgressBar(dt);
    }

    runAgain () {
        // 只用在按钮上(不重要)
        this.node.getComponent(cc.Sprite).fillRange = 1;
    }
}
